{extend name='admin@public/content'}

{block name="content"}

		
<div>
    <h3 style="padding-left: 50px; text-align: center; color: #5289f1;display: inline;">当月销售图表</h3>   <a href="/admin/index/export?time=thisMonth" style="color: red; font-size: 18px; padding-left: 30px;" target="_blank">下载当月汇总数据</a>
    <div id="thisMonthOrder"></div>

    <h3 style="padding-left: 50px; text-align: center; color: #5289f1;display: inline;">上个月销售图表</h3>  <a href="/admin/index/export?time=lastMonth" style="color: red; font-size: 18px; padding-left: 30px;" target="_blank">下载上个月汇总数据</a>
    <div id="lastMonthOrder"></div>
</div>

<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g2-3.2.8/dist/g2.min.js"></script>
<script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.data-set-0.9.6/dist/data-set.min.js">

<script  type="application/javascript">
    var data =<?php echo ($thisMonthOrder);?>;
    var chart = new G2.Chart({
        container: 'thisMonthOrder',
         forceFit: true,
        height : 400 // 指定图表高度
    });
    chart.source(data);
    chart.scale('totals',{
        min: 0,
        alias:'销售额'
    });
    chart.axis('totals', {
        label: {
            formatter: function formatter(val) {
                return val + '元';
            }
        }
    });
    chart.line().position('time*totals').shape('smooth');
    chart.point().position('time*totals').size(4).shape('circle').style({
        stroke: '#fff',
        lineWidth: 1
    });
    chart.render();



    var data1 =<?php echo ($lastMonthOrder);?>;
    var chart = new G2.Chart({
        container: 'lastMonthOrder',
        forceFit: true,
        height : 400 // 指定图表高度
    });
    chart.source(data1);
    chart.scale('totals',{
        min: 0,
        alias:'销售额'
    });
    chart.axis('totals', {
        label: {
            formatter: function formatter(val) {
                return val + '元';
            }
        }
    });
    chart.line().position('time*totals').shape('smooth');
    chart.point().position('time*totals').size(4).shape('circle').style({
        stroke: '#fff',
        lineWidth: 1
    });
    chart.render();
</script>


{/block}